﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SistemadeEstágios
{
    public partial class frmEscolha : Form
    {
        public int iRetorno { get; set; }

        public bool bRetorno { get; set; }


        public frmEscolha()
        {
            InitializeComponent();
        }

        private void BtnSair_Click(object sender, EventArgs e)
        {
            bRetorno = false;
            Hide();
        }

        private void BtnConfirmar_Click(object sender, EventArgs e)
        {
            if (cbEscolha.SelectedIndex > 0)
            {
                iRetorno = cbEscolha.SelectedIndex;
                bRetorno = true;
            }
            else
            {
                iRetorno = 0;
                bRetorno = false;
            }
            Hide();
        }

        private void frmEscolha_KeyUp(object sender, KeyEventArgs e)
        {
            if ((e.KeyData == Keys.Escape) || (e.KeyData == Keys.Enter))
            {
                BtnConfirmar_Click(BtnConfirmar, new EventArgs());
            }
        }

    }
}
